<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                template="./resources/mastersPages/MasterPage.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">

    <ui:define name="content">

        <h:form class="form-group" acceptcharset="ISO-8859-1" lang="pt_BR">
            <h1><i class="glyphicon glyphicon-edit"></i>Cadastrar Objetivo</h1> 

            <fieldset>
                <h:inputHidden value="#{objetivoMB.objetivoBO.idObjetivo}" />
                <legend><i class="glyphicon glyphicon-home" ></i>  Detalhes</legend>
                <div id="divID" class="row">
                    <div class="form-group  col-sm-1 ">
                        <label>Id</label>
                        <h:inputText readonly="true" class="form-control"  value="#{objetivoMB.objetivoBO.idObjetivo}" />
                    </div>
                </div>
                <div id="divDadosIniciais" class="row full">

                    <div class="form-group col-sm-8">
                        <label>Titulo</label>
                        <h:inputText  class="form-control" value="#{objetivoMB.objetivoBO.nome}"/>
                    </div>

                </div>
                <div id="divDadosIniciais" class="row">

                    <div class="form-group col-sm-8">
                        <label>Descrição</label>
                        <h:inputTextarea  rows="5"  class="form-control" value="#{objetivoMB.objetivoBO.descricao}" />
                    </div>

                </div>
                <div id="divDadosIniciais" class="row full">

                    <div class="form-group col-sm-2" >
                        <label ID="lblinstituicao">Intituição</label>
                        <h:selectOneMenu class="input input-sm" label="lblinstituicao" value="#{objetivoMB.objetivoBO.instituicaoBO}" 
                                         converter="conversorInstituicao">
                            <f:selectItem itemLabel="Selecione uma instituição..." itemValue="-1" 
                                          />
                            <f:selectItems  value="#{objetivoMB.instituicoes}" var="instituicao" 
                                            itemLabel="#{instituicao}" 
                                            itemValue="#{instituicao}" 
                                            />
                        </h:selectOneMenu>
                    </div>
                </div>

                <div class="row">
                    <div class="form-group col-sm-8 ">
                        <label>Status</label>
                        <h:selectOneRadio  value="#{objetivoMB.objetivoBO.status}" class=" ">
                            <f:selectItem  itemValue="1" itemLabel=" Ativo"  />
                            <f:selectItem  itemValue="2" itemLabel=" Inativo"  />
                        </h:selectOneRadio>
                    </div>
                </div>

                <h:commandLink action="#{objetivoMB.novo()}" class="btn btn-primary" >
                    <i class="glyphicon glyphicon-plus"></i>Novo
                </h:commandLink>       
                <h:commandLink class="btn btn-info" action="#{objetivoMB.salvar()}" style="margin-left: 30px;">
                    <i class="glyphicon glyphicon-floppy-saved"></i>
                    Salvar
                </h:commandLink>       
            </fieldset>
        </h:form>

    </ui:define>

</ui:composition>
